﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace Axial
{
	public static partial class CallHandler
	{
		[CallHandler(typeof(Canvas))]
		private static string HandleCanvasRequest(MethodInfo method, object called, object[] stack)
		{
			string domElement = GetDomElement(called);
			if (method.Name == "GetContext")
				return string.Format("{0}.getContext({1})", domElement, stack[0]);
			return null;
		}
		[CallHandler(typeof(CanvasContext))]
		private static string HandleCanvasContextRequest(MethodInfo method, object called, object[] stack)
		{
			return StandardHandler(method, called, stack);
		}
	}
}
